﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BLL;
using Model;
using System.Data;
using System.Data.SqlClient;
using Word = Microsoft.Office.Interop.Word;
using Microsoft.Office.Interop.Word;
using System.IO;
using System.Reflection;
using System.Windows.Forms;

namespace NCRE学生考试端V1._0
{
    public  class WordAPageOperate
    {
        private static Microsoft.Office.Interop.Word.Application app = new Microsoft.Office.Interop.Word.Application();
        private static object unknow = Type.Missing;
        //private static object file = @"D:\" +MyInfo.MystudentID ()+ @"\计算机一级考生文件\A卷\Wordkt\WordA.docx";
        private static object file = @"D:\" + MyInfo.MystudentID() + @"\计算机一级考生文件\"+MyInfo.MyPaperType().Trim() + "卷\\Wordkt\\Word"+ MyInfo.MyPaperType().Trim()+".docx";
        private readonly  Microsoft.Office.Interop.Word.Document doc = app.Documents.Add(ref file, ref unknow, ref unknow, ref unknow);
        private static Microsoft.Office.Interop.Word.Document word = app.Documents.Add(ref file, ref unknow, ref unknow, ref unknow);
        private readonly WordQuestionEntityBll wordquestionbll = new WordQuestionEntityBll();
        private readonly WordQuestionEntity wordinfo = new WordQuestionEntity();
        readonly Range allRange = word.Range(oMissing, oMissing);
        private static object oMissing = System.Reflection.Missing.Value;
        readonly    WordLoadinfo gonggong = new WordLoadinfo();

        #region 王荣晓 页边距上下
        /// <summary>
        /// 上下页边距操作
        /// </summary>
        /// <param name="wordinfo"></param>
        public void PageMarginUpOperate(WordQuestionEntity wordinfo, System.Data.DataTable dt)
        {

            DataRow[] drs_word = dt.Select("QuestionFlag like '%页边距上下%'");
            WordQuestionRecordEntity studentrecord = new WordQuestionRecordEntity();
            studentrecord.TimeStamp = MyInfo.TimeTamp();
            //传递考生ID进studentrecord实体
            studentrecord.StudentID = FrmLogin.studentID;
            //将考生答案的上下边距边距传递给studentrecord实体               
            studentrecord.ExamAnswer = doc.PageSetup.TopMargin.ToString();
            //将试题的ID选择出来
            if (drs_word.Count() == 0)
            {
                return;
            }
            studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);
            //判分
            WordLoadinfo.list.Add(gonggong.getStudentRecord(drs_word, studentrecord));
        }
        #endregion

        #region 王荣晓 页边距左右
        /// <summary>
        /// 左右页边距操作
        /// </summary>
        /// <param name="wordinfo"></param>
        public void PageMarginLeftOperate(WordQuestionEntity wordinfo, System.Data.DataTable dt)
        {

            DataRow[] drs_word = dt.Select("QuestionFlag like '%页边距左右%'");
            WordQuestionRecordEntity studentrecord = new WordQuestionRecordEntity();
            //传递考生ID进studentrecord实体
            studentrecord.TimeStamp = MyInfo.TimeTamp();
            studentrecord.StudentID = FrmLogin.studentID;
            //将考生答案的左右边距边距传递给studentrecord实体               
            studentrecord.ExamAnswer = doc.PageSetup.LeftMargin.ToString() + doc.PageSetup.RightMargin.ToString();
            //将试题的ID选择出来
            if (drs_word.Count() == 0)
            {
                return;
            }
            studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);
            //判分
            WordLoadinfo.list.Add(gonggong.getStudentRecord(drs_word, studentrecord));

        }
        #endregion

        #region 王荣晓 装订线位置
        /// <summary>
        /// 装订线位置
        /// </summary>
        /// <param name="wordinfo"></param>
        public void GutterPosition(WordQuestionEntity wordinfo, System.Data.DataTable dt)
        {

            DataRow[] drs_word = dt.Select("QuestionFlag like '%装订线位置%'");
            WordQuestionRecordEntity studentrecord = new WordQuestionRecordEntity();
            //传递考生ID进studentrecord实体
            studentrecord.TimeStamp = MyInfo.TimeTamp();
            studentrecord.StudentID = FrmLogin.studentID;
            //将考生答案的左右边距边距传递给studentrecord实体               
            studentrecord.ExamAnswer = doc.PageSetup.GutterPos.ToString();
            //将试题的ID选择出来
            if (drs_word.Count() == 0)
            {
                return;
            }
            studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);
            //判分
            WordLoadinfo.list.Add(gonggong.getStudentRecord(drs_word, studentrecord));
        }
        #endregion

        #region 王荣晓 纸张方向
        /// <summary>
        /// 纸张方向
        /// </summary>
        /// <param name="wordinfo"></param>
        public void PageDirection(WordQuestionEntity wordinfo, System.Data.DataTable dt)
        {
            DataRow[] drs_word = dt.Select("QuestionFlag like '%纸张方向%'");
            WordQuestionRecordEntity studentrecord = new WordQuestionRecordEntity();

            //传递考生ID进studentrecord实体
            studentrecord.TimeStamp = MyInfo.TimeTamp();
            studentrecord.StudentID = FrmLogin.studentID;
            //将考生答案的上下边距边距传递给studentrecord实体               
            studentrecord.ExamAnswer = doc.PageSetup.SectionDirection.ToString();
            //将试题的ID选择出来
            if (drs_word.Count() == 0)
            {
                return;
            }
            studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);
            //判分
            WordLoadinfo.list.Add(gonggong.getStudentRecord(drs_word, studentrecord));

        }
        #endregion

        #region 王荣晓 纸张大小
        /// <summary>
        /// 纸张大小
        /// </summary>
        /// <param name="wordinfo"></param>
        public void PageSize(WordQuestionEntity wordinfo, System.Data.DataTable dt)
        {
            DataRow[] drs_word = dt.Select("QuestionFlag like '%纸张大小%'");
            WordQuestionRecordEntity studentrecord = new WordQuestionRecordEntity();

            //传递考生ID进studentrecord实体
            studentrecord.TimeStamp = MyInfo.TimeTamp();
            studentrecord.StudentID = FrmLogin.studentID;
            //将考生答案的上下边距边距传递给studentrecord实体               
            studentrecord.ExamAnswer = doc.PageSetup.PaperSize.ToString();
            //将试题的ID选择出来
            if (drs_word.Count() == 0)
            {
                return;
            }
            studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);
            //判分
            WordLoadinfo.list.Add(gonggong.getStudentRecord(drs_word, studentrecord));

        }
        #endregion

        #region 王荣晓 查找页码
        /// <summary>
        /// 查找页码
        /// </summary>
        /// <param name="wordinfo"></param>
        public void FindPageNum(WordQuestionEntity wordinfo, System.Data.DataTable dt)
        {
            DataRow[] drs_word = dt.Select("QuestionFlag like '%查找页码%'");
            WordQuestionRecordEntity studentrecord = new WordQuestionRecordEntity();
            //传递考生ID进studentrecord实体
            studentrecord.StudentID = FrmLogin.studentID;
            studentrecord.TimeStamp = MyInfo.TimeTamp();
            //将考生答案的上下边距边距传递给studentrecord实体               
            studentrecord.ExamAnswer = doc.Footnotes.StartingNumber.ToString();
            //将试题的ID选择出来
            if (drs_word.Count() == 0)
            {
                return;
            }
            studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);
            //判分
            WordLoadinfo.list.Add(gonggong.getStudentRecord(drs_word, studentrecord));
        }
        #endregion

        #region 王荣晓 查找图片
        /// <summary>
        /// 查找图片
        /// </summary>
        /// <param name="wordinfo"></param>
        public void FindPicture(WordQuestionEntity wordinfo, System.Data.DataTable dt)
        {
            DataRow[] drs_word = dt.Select("QuestionFlag like '%查找图片%'");
            WordQuestionRecordEntity studentrecord = new WordQuestionRecordEntity();

            //传递考生ID进studentrecord实体
            studentrecord.StudentID = FrmLogin.studentID;
            studentrecord.TimeStamp = MyInfo.TimeTamp();
            //将考生答案的上下边距边距传递给studentrecord实体               
            studentrecord.ExamAnswer = doc.Shapes.Count.ToString();
            //将试题的ID选择出来
            if (drs_word.Count() == 0)
            {
                return;
            }
            studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);
            //判分
            WordLoadinfo.list.Add(gonggong.getStudentRecord(drs_word, studentrecord));

        }
        #endregion

        #region 王荣晓 图片高度
        /// <summary>
        /// 查找图片
        /// </summary>
        /// <param name="wordinfo"></param>
        public void PictureWidth(WordQuestionEntity wordinfo, System.Data.DataTable dt, Int32 Para_PictureID)
        {
            WordQuestionRecordEntity studentrecord = new WordQuestionRecordEntity();
            DataRow[] drs_word = dt.Select("QuestionFlag like '%图片高度%'");
            if (doc.Shapes.Count == 0)
            {
                //如果表格不存在，则判分为0
                studentrecord.TimeStamp = MyInfo.TimeTamp();
                studentrecord.StudentID = FrmLogin.studentID;
                studentrecord.ExamAnswer = "0";
                studentrecord.Fration = "0";
                //将答题记录送到数据库
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (drs_word.Count() == 0)
                    {
                        return;
                    }
                    studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);
                }
                WordLoadinfo.list.Add(studentrecord);

            }
            else
            {
                studentrecord.TimeStamp = MyInfo.TimeTamp();
                //传递考生ID进studentrecord实体
                studentrecord.StudentID = FrmLogin.studentID;
                //将考生答案的上下边距边距传递给studentrecord实体               
                studentrecord.ExamAnswer = doc.Shapes[Para_PictureID].Height.ToString() + doc.Shapes[Para_PictureID].Width.ToString();
                //将试题的ID选择出来
                if (drs_word.Count() == 0)
                {
                    return;
                }
                studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);
                //判分
                WordLoadinfo.list.Add(gonggong.getStudentRecord(drs_word, studentrecord));
            }

        }
        #endregion

        #region 李少然 页边距  修改人：于云秀 2018年4月24日08:22:45
        /// <summary>
        /// 页边距
        /// </summary>
        /// <param name="wordinfo"></param>
        public void PageMarginUpOperateH(WordQuestionEntity wordinfo, System.Data.DataTable dt)
        {
            DataRow[] drs_word = dt.Select("QuestionFlag='页边距'");
            WordQuestionRecordEntity studentrecord = new WordQuestionRecordEntity();
            studentrecord.TimeStamp = MyInfo.TimeTamp();
            //传递考生ID进studentrecord实体
            studentrecord.StudentID = FrmLogin.studentID;
            //将考生答案传递给studentrecord实体
            studentrecord.ExamAnswer = doc.PageSetup.TopMargin.ToString() + doc.PageSetup.BottomMargin.ToString() + doc.PageSetup.LeftMargin.ToString() + doc.PageSetup.RightMargin.ToString();
            if (drs_word.Count() == 0)
            {
                return;
            }
            studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);
            //判分         
            WordLoadinfo.list.Add(gonggong.getStudentRecord(drs_word, studentrecord));


        }
        #endregion

        #region 李少然 页码格式  修改人：于云秀 2018年4月24日08:22:45
        /// <summary>
        /// 页码格式
        /// </summary>
        /// <param name="wordinfo">题库实体</param>
        public void SearchPageF(WordQuestionEntity wordinfo, System.Data.DataTable dt, Int32 Para_HeaderFooterID)
        {
            WordQuestionRecordEntity studentrecord = new WordQuestionRecordEntity();
            DataRow[] drs_word = dt.Select("QuestionFlag='页码格式'");
            studentrecord.TimeStamp = MyInfo.TimeTamp();
            if (allRange.Sections.Count != 0)
            {
                if (allRange.Sections[Para_HeaderFooterID].Headers[WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Text == "\r" || allRange.Sections[Para_HeaderFooterID].Headers[WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Text.Trim().ToString() == "")
                {
                    //如果表格不存在，则判分为0
                    studentrecord.StudentID = FrmLogin.studentID;
                    studentrecord.ExamAnswer = "空答案";
                    studentrecord.Fration = "0";
                    //将答题记录送到数据库
                    if (drs_word.Count() == 0)
                    {
                        return;
                    }
                    studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);

                    WordLoadinfo.list.Add(studentrecord);

                }
                else
                {
                    //传递考生ID进studentrecord实体
                    studentrecord.StudentID = FrmLogin.studentID;

                    //将考生答案传递给studentrecord实体
                    studentrecord.ExamAnswer = allRange.Sections[1].Footers[WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Text.Trim().ToString();
                    //将试题的ID选择出来
                    if (drs_word.Count() == 0)
                    {
                        return;
                    }
                    studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);
                    //判分
                    WordLoadinfo.list.Add(gonggong.getStudentRecord(drs_word, studentrecord));

                }
            }
            else
            {
                //传递时间戳进studentrecord实体
                studentrecord.TimeStamp = MyInfo.TimeTamp();
                //如果表格不存在，则判分为0
                studentrecord.StudentID = FrmLogin.studentID;
                studentrecord.ExamAnswer = "空答案";
                studentrecord.Fration = "0";
                //将答题记录送到数据库

                if (drs_word.Count() == 0)
                {
                    return;
                }
                studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);

                WordLoadinfo.list.Add(studentrecord);
            }



        }
        #endregion

        #region 王荣晓 页眉文字
        /// <summary>
        /// 页眉文字
        /// </summary>
        /// <param name="wordinfo"></param>
        public void HeaderTextSetC(WordQuestionEntity wordinfo, System.Data.DataTable dt, Int32 Para_HeaderFooterID)
        {
            WordQuestionRecordEntity studentrecord = new WordQuestionRecordEntity();

            DataRow[] drs_word = dt.Select("QuestionFlag='页眉文字'");
            studentrecord.TimeStamp = MyInfo.TimeTamp();
            if (allRange.Sections[Para_HeaderFooterID].Headers[Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Text == "\r")
            {

                //如果表格不存在，则判分为0
                studentrecord.StudentID = FrmLogin.studentID;
                studentrecord.ExamAnswer = "0";
                studentrecord.Fration = "0";
                //将答题记录送到数据库
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (drs_word.Count() == 0)
                    {
                        return;
                    }
                    studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);
                }
                WordLoadinfo.list.Add(studentrecord);

            }
            else
            {
                //传递考生ID进studentrecord实体
                studentrecord.StudentID = FrmLogin.studentID;

                //将考生答案传递给studentrecord实体
                studentrecord.ExamAnswer = allRange.Sections[1].Headers[WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Text.ToString();
                //将试题的ID选择出来
                if (drs_word.Count() == 0)
                {
                    return;
                }
                studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);
                //判分
                WordLoadinfo.list.Add(gonggong.getStudentRecord(drs_word, studentrecord));


            }

        }



        #endregion

        #region 王荣晓 页眉字体型号
        /// <summary>
        /// 页眉字体型号
        /// </summary>
        /// <param name="wordinfo"></param>
        public void HeaderTextTypeSetC(WordQuestionEntity wordinfo, System.Data.DataTable dt, Int32 Para_HeaderFooterID)
        {

            DataRow[] drs_word = dt.Select("QuestionFlag='页眉字体型号'");
            WordQuestionRecordEntity studentrecord = new WordQuestionRecordEntity();

            //将考生答案传递给studentrecord实体
            if (allRange.Sections[Para_HeaderFooterID].Headers.Count == 0)
            {
                //传递考生ID进studentrecord实体
                studentrecord.TimeStamp = MyInfo.TimeTamp();
                studentrecord.StudentID = FrmLogin.studentID;
                studentrecord.ExamAnswer = "0";
                studentrecord.Fration = "0";
                //将答题记录送到数据库
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (drs_word.Count() == 0)
                    {
                        return;
                    }
                    studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);
                }
                WordLoadinfo.list.Add(studentrecord);

            }
            else
            {
                studentrecord.TimeStamp = MyInfo.TimeTamp();
                //传递考生ID进studentrecord实体
                studentrecord.StudentID = FrmLogin.studentID;

                //将考生答案传递给studentrecord实体
                studentrecord.ExamAnswer = allRange.Sections[Para_HeaderFooterID].Headers[WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Font.Name.ToString();
                //将试题的ID选择出来
                if (drs_word.Count() == 0)
                {
                    return;
                }
                studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);
                //判分
                WordLoadinfo.list.Add(gonggong.getStudentRecord(drs_word, studentrecord));

            }



        }

        #endregion

        #region 王荣晓 页眉字体大小
        /// <summary>
        /// 页眉字体大小
        /// </summary>
        /// <param name="wordinfo"></param>
        public void HeaderTextSizeSetC(WordQuestionEntity wordinfo, System.Data.DataTable dt, Int32 Para_HeaderFooterID)
        {


            WordQuestionRecordEntity studentrecord = new WordQuestionRecordEntity();

            DataRow[] drs_word = dt.Select("QuestionFlag='页眉字体大小'");

            if (allRange.Sections[Para_HeaderFooterID].Headers.Count == 0)
            {
                studentrecord.TimeStamp = MyInfo.TimeTamp();
                //如果表格不存在，则判分为0
                studentrecord.StudentID = FrmLogin.studentID;
                studentrecord.ExamAnswer = "0";
                studentrecord.Fration = "0";
                //将答题记录送到数据库
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (drs_word.Count() == 0)
                    {
                        return;
                    }
                    studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);
                }
                WordLoadinfo.list.Add(studentrecord);

            }
            else
            {
                studentrecord.TimeStamp = MyInfo.TimeTamp();
                //传递考生ID进studentrecord实体
                studentrecord.StudentID = FrmLogin.studentID;

                //将考生答案传递给studentrecord实体
                studentrecord.ExamAnswer = allRange.Sections[Para_HeaderFooterID].Headers[WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Font.Size.ToString();
                //将试题的ID选择出来
                if (drs_word.Count() == 0)
                {
                    return;
                }
                studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);
                //判分
                WordLoadinfo.list.Add(gonggong.getStudentRecord(drs_word, studentrecord));

            }

        }

        #endregion

        #region 王荣晓 页眉字体格式
        /// <summary>
        /// 页眉字体格式
        /// </summary>
        /// <param name="wordinfo"></param>
        public void HeaderTextFormatSetC(WordQuestionEntity wordinfo, System.Data.DataTable dt)
        {
            //将正确答案、分值取出来，传给dt
            wordinfo.QuestionFlag = "页眉字体格式";
            DataRow[] drs_word = dt.Select("QuestionFlag='页眉字体格式'");
            WordQuestionRecordEntity studentrecord = new WordQuestionRecordEntity();
            //传递考生ID进studentrecord实体
            studentrecord.TimeStamp = MyInfo.TimeTamp();
            studentrecord.StudentID = FrmLogin.studentID;
            //将考生答案传递给studentrecord实体
            studentrecord.ExamAnswer = app.ActiveWindow.View.SeekView.ToString();
            //将试题的ID选择出来
            if (drs_word.Count() == 0)
            {
                return;
            }
            studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);
            //判分         
            WordLoadinfo.list.Add(gonggong.getStudentRecord(drs_word, studentrecord));

        }

        #endregion

        #region 李少然 页眉页脚边距 修改人：于云秀 2018年4月24日08:37:01
        /// <summary>
        /// 页眉页脚边距
        /// </summary>
        /// <param name="wordinfo">题库实体</param>
        public void PageMarginTopOperate(WordQuestionEntity wordinfo, System.Data.DataTable dt)
        {
            DataRow[] drs_word = dt.Select("QuestionFlag='页眉页脚边距'");
            WordQuestionRecordEntity studentrecord = new WordQuestionRecordEntity();
            studentrecord.TimeStamp = MyInfo.TimeTamp();
            //传递考生ID进studentrecord实体
            studentrecord.StudentID = FrmLogin.studentID;
            //将考生答案传递给studentrecord实体
            studentrecord.ExamAnswer = app.ActiveDocument.PageSetup.HeaderDistance.ToString();
            if (drs_word.Count() == 0)
            {
                return;
            }
            studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);
            //判分         
            WordLoadinfo.list.Add(gonggong.getStudentRecord(drs_word, studentrecord));
        }
        #endregion

        #region 李少然 页眉格式 修改人：于云秀 2018年4月24日08:37:01
        /// <summary>
        /// 页眉格式
        /// </summary>
        /// <param name="wordinfo">题库实体</param>
        public void PageHeaderFormatE(WordQuestionEntity wordinfo, System.Data.DataTable dt, Int32 Para_HeaderFooterID)
        {
            WordQuestionRecordEntity studentrecord = new WordQuestionRecordEntity();

            DataRow[] drs_word = dt.Select("QuestionFlag='页眉格式'");
            if (allRange.Sections.Count >= Para_HeaderFooterID)
            {
                if (allRange.Sections[Para_HeaderFooterID].Headers[WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Text == "\r" || allRange.Sections[Para_HeaderFooterID].Headers[WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Text.Trim().ToString() == "")
                {
                    //传递时间戳进studentrecord实体
                    studentrecord.TimeStamp = MyInfo.TimeTamp();
                    //如果页眉不存在不存在，则判分为0
                    studentrecord.StudentID = FrmLogin.studentID;
                    studentrecord.ExamAnswer = "空答案";
                    studentrecord.Fration = "0";
                    //将答题记录送到数据库
                    if (drs_word.Count() == 0)
                    {
                        return;
                    }
                    studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);

                    WordLoadinfo.list.Add(studentrecord);

                }
                else
                {
                    //传递考生ID进studentrecord实体
                    studentrecord.StudentID = FrmLogin.studentID;
                    //传递时间戳进studentrecord实体
                    studentrecord.TimeStamp = MyInfo.TimeTamp();
                    //将考生答案传递给studentrecord实体
                    studentrecord.ExamAnswer = app.ActiveWindow.View.SeekView.ToString();
                    //将试题的ID选择出来
                    if (drs_word.Count() == 0)
                    {
                        return;
                    }
                    studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);
                    //判分
                    WordLoadinfo.list.Add(gonggong.getStudentRecord(drs_word, studentrecord));

                }
            }

            else
            {
                studentrecord.ExamAnswer = "空答案";
                studentrecord.Fration = "0";
                //将答题记录送到数据库

                if (drs_word.Count() == 0)
                {
                    return;
                }
                studentrecord.QuestionID = Convert.ToDouble(drs_word[0]["QuestionID"]);

                WordLoadinfo.list.Add(studentrecord);
            }



        }
        #endregion
    }
}
